package util;

import com.alibaba.fastjson.JSONObject;
import org.junit.runner.RunWith;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;

import javax.annotation.Resource;

@ContextConfiguration(locations = {"classpath*:ctx-mvc.xml"})
@RunWith(SpringJUnit4ClassRunner.class)
public class BaseTestUnit {

    @Resource
    protected ApplicationContext applicationContext;

    protected void say(Object result) {
        if (result == null) {
            System.out.println("result is null");
        } else {
            System.out.println(JSONObject.toJSONString(result));
        }
    }
}
